\version "2.14.0"  % necessary for upgrading to future LilyPond versions.
%{

Lumen Christi Missal Psalm Tone Template: SATB
by Aristotle A. Esguerra
Version 0.1.4-20121108
Sample Tone: 4G SATB B

%}
\include "include.ly"
%header%

  %% \chantMode passes one of the above into the globals in the LAYOUT
  %%            section below the SATB 

  chantMode = \modeIV

  psalmToneLyric = \lyricmode { \override StanzaNumber #'extra-offset = #'(%modeoffset:0% . 0) \set stanza = "%annotation%" "" }
  psalmTone = "Tone %annotation%"  %% Specify the name of the psalm tone here

  psalmTone = \markup \abs-fontsize #9 { \psalmTone }

 %%% GUITAR CHORDS
  %% - Included here as a proof-of-concept sort of thing
  %% - This would be an input or textarea field on the Web app

  psalmToneHarmonies = \chordmode {
  }

 %%% SOPRANO
  %% - This would be an input or textarea field on the Web app
  %% - Note the use of the chant breaks in all parts

  aSop = \transpose %key:c% %transposekey:c% {
    \relative c' {
      %\override TextScript #'outside-staff-padding = #10
      %\override Score.RehearsalMark #'break-align-symbols = #'(key-signature)
%      \once \override Score.KeySignature #'break-align-anchor-alignment = #RIGHT
%      \once \override Score.RehearsalMark #'extra-offset = #'(0.5 . -0.25)
%      \once \override Score.RehearsalMark #'self-alignment-X = #LEFT
%      \once \override Score.RehearsalMark #'padding = #1.9
%      \mark \psalmTone
      \cadenzaOn
      %sop%
      \cadenzaOff
    }
  }

 %%% ALTO
  %% - This would be an input or textarea field on the Web app
  %% - Note the use of the chant breaks in all parts

  aAlt = \transpose %key:c% %transposekey:c% {
    \relative c' {
    \cadenzaOn
      %alt%
      
    \cadenzaOff
    }
  }

 %%% TENOR
  %% - This would be an input or textarea field on the Web app
  %% - Note the use of the chant breaks in all parts

  aTen = \transpose %key:c% %transposekey:c% {
    \relative c' {
    \cadenzaOn
      %ten%
    \cadenzaOff
    }
  }

 %%% BASS
  %% - This would be an input or textarea field on the Web app
  %% - Note the use of the chant breaks in all parts

  aBas = \transpose %key:c% %transposekey:c% {
    \relative c' {
    \cadenzaOn
      %bas%
    \cadenzaOff
    }
  }

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%% LAYOUT PREP
  %% Below specs assume a pure LilyPond implementation
  %% Customize for integration into TeX

  #(set-global-staff-size %staffsize:16%)
  #(set-default-paper-size "letter")

global = \transpose %key:c% %transposekey:c% {
  %% Centers guitar chords over noteheads
  #(define (centerCN grob)
     (ly:stencil-aligned-to (ly:text-interface::print grob) X CENTER )) 
  %% Calls chantMode specified above
  \key %key:c% \major
  % To add extra padding for the cf text:
  \override TextScript #'staff-padding = #1.0
}

  %% Below specs assume a pure LilyPond implementation
  %% Customize for integration into TeX

\paper {
  indent = 0\in
  annotate-spacing = ##f
  top-margin = .5\in
  left-margin = .5\in
  bottom-margin = .5\in
  
  markup-system-spacing =
    #'((basic-distance . 4.5)
       (minimum-distance . 4.5)
       (padding . 0.5)
       (stretchability . 0))
  system-system-spacing =
    #'((basic-distance . 10)
       (minimum-distance . 10)
       (padding . 0)
       (stretchability . 0))
  score-markup-spacing =
    #'((basic-distance . 4.5)
       (minimum-distance . 4.5)
       (padding . 0)
       (stretchability . 0))

  paper-height = %height%\in
  line-width = %width%\in %% presets can be specified in the web form
                      %% note that this doesn't include the width
                      %% of the system brace.
  paper-width = %width%\in
  left-margin = 0\in
  right-margin = 0\in
  myStaffSize = #%staffsize:16%   %% Same as #(set-global-staff size)

  %% FONT SPECIFICATIONS FOR LYRICS
  %% - Like in the Gregorio app, a dropdown can be created for the user
  %%   to specify the desired lyric font.
  %% - Users should be allowed to choose only the first font; the second 
  %%   and third fonts are for 'sans' and 'fixed-width' font overrides.
  %% - Alternatively, you can pass the same font into all three fields.

  #(define fonts
    (make-pango-font-tree "Garamond Premier Pro"
                          "Arial"
                          "Courier"
                           (/ myStaffSize 20)))

  %% eliminates headers and footers; may not be necessary in a
  %% TeX integration
  oddHeaderMarkup = \markup \null
  evenHeaderMarkup = \markup \null
  oddFooterMarkup = \markup { \fill-line { } }
  evenFooterMarkup = \oddFooterMarkup
  ragged-last = ##%raggedlast:f%
}
\include "layout-acc-tone-%layout:satb%.ly"